import axios from '@/libs/api.request'
import platform from '@/config/platform'
// 修改

// 跳转登录
export const toLoginPage = params => {
  return axios.request({
    url: platform.BOOKING_WWX + '/oauth2/authorize',
    method: 'get',
    params
  })
}
// 获取token
export const getToken = data => {
  return axios.request({
    url: platform.BOOKING_WWX + '/oauth2/token',
    method: 'post',
    data
  })
}
// 获取用户身份信息(权限)
export const identities = data => {
  return axios.request({
    url: platform.SSO + '/oauth2/identities-permissions',
    method: 'get'
  })
}
// 获取用户信息
export const getUserInfo = params => {
  return axios.request({
    url: platform.BOOKING_WWX + '/user-info',
    method: 'get',
    params
  })
}
//= 退出登录
export const LogOut = params => {
  return axios.request({
    url: platform.BOOKING_WWX + '/oauth2/logout',
    method: 'get',
    params
  })
}
// 更新用户
export const editUser = data => {
  return axios.request({
    url: '/user',
    data,
    method: 'put'
  })
}
// 删除用户
export const delUser = id => {
  return axios.request({
    url: '/user/' + id,
    method: 'delete'
  })
}
